using ProcessManagementApi.DTO;
using MESData.ErrorCode;

namespace ProcessManagementApi.Services
{
    /// <summary>
    /// 工序分类服务接口
    /// </summary>
    public interface IProcessCategoryService
    {
        /// <summary>
        /// 分页查询工序分类
        /// </summary>
        /// <param name="queryDto">查询条件</param>
        /// <returns>分页结果</returns>
        Task<ApiPageing<ProcessCategoryResultDto>> GetProcessCategoriesAsync(ProcessCategoryQueryDto queryDto);

        /// <summary>
        /// 根据ID获取工序分类详情
        /// </summary>
        /// <param name="id">工序分类ID</param>
        /// <returns>工序分类详情</returns>
        Task<ApiResult<ProcessCategoryResultDto>> GetProcessCategoryByIdAsync(int id);

        /// <summary>
        /// 创建工序分类
        /// </summary>
        /// <param name="createDto">创建DTO</param>
        /// <returns>创建结果</returns>
        Task<ApiResult<ProcessCategoryResultDto>> CreateProcessCategoryAsync(ProcessCategoryCreateDto createDto);

        /// <summary>
        /// 更新工序分类
        /// </summary>
        /// <param name="updateDto">更新DTO</param>
        /// <returns>更新结果</returns>
        Task<ApiResult<ProcessCategoryResultDto>> UpdateProcessCategoryAsync(ProcessCategoryUpdateDto updateDto);

        /// <summary>
        /// 删除工序分类
        /// </summary>
        /// <param name="id">工序分类ID</param>
        /// <returns>删除结果</returns>
        Task<ApiResult<bool>> DeleteProcessCategoryAsync(int id);

        /// <summary>
        /// 获取所有启用的工序分类（用于下拉选择）
        /// </summary>
        /// <returns>工序分类列表</returns>
        Task<ApiResult<List<ProcessCategoryResultDto>>> GetActiveProcessCategoriesAsync();

        /// <summary>
        /// 导出工序分类到Excel
        /// </summary>
        /// <param name="queryDto">查询条件</param>
        /// <returns>Excel文件字节数组</returns>
        Task<byte[]> ExportProcessCategoriesToExcelAsync(ProcessCategoryExportQueryDto queryDto);
    }
} 